<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="/assets/css/text.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/main.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/content.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="/assets/js/common.js"></script>
    <script language="javascript" src="/assets/js/general.js"></script>
    <script language="JavaScript" type="text/JavaScript">
    </script>
    <style>
        #title {
            width: 92%;
            border: 0px;
            margin-bottom: 10px;
        }

        #title td {
            text-align: center;
            height: 20px;
            line-height: 150%
        }

        #title div {
            background-image: url(/assets/img/dot_02.gif);
            background-position: left top;
            background-repeat: no-repeat;
            margin: 0 auto;
            padding-left: 20px;
            text-align: left;
            width: 10%;
            font-size: 15px;
            font-weight: bold;
            color: #CC0000;
            letter-spacing: 2px;
        }
    </style>
    <script>
        <c:if test="${not empty msg}">
                alert('${msg}');
        </c:if>
    </script>
</head>
<body>

<table cellspacing="0" cellpadding="0" id="title" align="center">
    <tbody>
    <tr>
        <td nowrap="nowrap">
            <div>供应商管理</div>
        </td>
    </tr>
    </tbody>
</table>

<table cellpadding="0" cellspacing="0" class="datalist" align="center">
    <tbody>
    <tr align="center">
        <form action="/supplierAdd.do" method="post">
            <td height="25" colspan="3" align="center">添加供应商：<input type="text"  name="sp_name" value="">
            <input type="submit" value="添加"></td>
        </form>
    </tr>
    <tr>
        <th height="25" align="center" >供应商编号</th>
        <th align="center" >供应商名称</th>
        <th align="center" >操作</th>
    </tr>
    <c:forEach items="${supplier}" var="s">
        <c:set var="sp_id" value="${s.sp_id}"/>
        <c:set var="sp_name" value="${s.sp_name}"/>
        <tr>
            <td height="25" align="center" >${fn:escapeXml(sp_id)}</td>
            <td align="center" >${fn:escapeXml(sp_name)}</td>
            <td align="center" ><a href="/supplierdel.do?sp_id=${fn:escapeXml(sp_id)}"><img src="/assets/img/icodelete.gif"></a></td>
        </tr>
    </c:forEach>

    <tr>
        <td><a href="/servlet/DownloadServlet?fileName=custom.xls&fileUUid=92B0CF1CF73447A19FFFBE49D32DD75C&filetype=8">批量导入模板下载</a>
        </td>
        <td>批量导入供应商资料：<input type="file" value=""/> <input type="submit" value="导入"/></td>
        <td><input type="button" value="导出xls"/></td>
    </tr>
    </tbody>
</table>
</body>
</html>